package cn.gjculture.shopping.api.entity;

import cn.gjculture.shopping.api.util.DateUtil;
import cn.gjculture.shopping.api.util.UUIDUtil;
import lombok.Data;
import lombok.Getter;

import java.util.List;

@Data
public class Order {

    private String orderId;
    private String customerId;
    private String orderSubject;
    private String orderSum;
    private String orderTotalSum;
    private List<GoodsRecord> goodsRecords;
    private List<CashCoupon> cashCoupons;
    private Integer orderType;
    private String useScore;
    private Long insertTime;
    private Long updateTime;
    private String addressId;
    private List<Logistics> logistics;
    private Long payTime;
    private Long sendOutTime;
    //1,新建；8，已付款；
    private Integer status=1;
    private String insertTimeStr;
    private String updateTimeStr;
    private Customer customer;
    private String mark;
    private Integer refundStatus;
    private String orderNoStr;
    private Long orderNo;
    private Address address;

    public Order(){
    }
    public Order(boolean init){
        if(init){
            this.orderId= UUIDUtil.getUUID();
            this.insertTime= DateUtil.getTimestamp();
            this.updateTime=DateUtil.getTimestamp();
        }
    }

    public enum OrderType{
        GOODS(1),HOTEL(2),OIL_CARD_BUY(3),OIL_CARD_CHARGE(4),ART(5),VIP_GOODS(6);
        @Getter
        private Integer value;
        OrderType(Integer value){
            this.value=value;
        }
    }

}
